#ifndef __XSIP_SMALL_REQUEST_H__
#define __XSIP_SMALL_REQUEST_H__
#include "xtransactionstate.h"
#include "DelayQueue.hh"
class XSIPTranaction;

class RetranEntry : public DelayQueueEntry {
public:
	RetranEntry(XSIPTransactionState* state, DelayInterval to);
	virtual ~RetranEntry();
	virtual void handleTimeout();
private:
	XSIPTransactionState *m_state;
};

class TimeoutEntry : public DelayQueueEntry {
public:
	TimeoutEntry(XSIPTransactionState* state, DelayInterval to);
	~TimeoutEntry();
	virtual void handleTimeout();
private:
	XSIPTransactionState *m_state;
};

class XSIPSmallClientTransactionState : public XSIPTransactionState {
public:
	XSIPSmallClientTransactionState(void *transaction);
	~XSIPSmallClientTransactionState();

	virtual int touch();
	virtual void complete();
	virtual void timeout();
private:
	DelayQueueEntry *m_retran;
	DelayQueueEntry *m_timeout;
	int m_ts;
	int m_contentIndex;
	int m_ret;
};

class XSIPSmallServerTransactionState : public XSIPTransactionState {
public:
	XSIPSmallServerTransactionState();
	~XSIPSmallServerTransactionState();

	virtual int touch();
	virtual void complete();
	virtual void timeout();
private:
	DelayQueueEntry *m_retran;
	DelayQueueEntry *m_timeout;
	int m_ts;
	int m_ack;
	int m_ret;
};

#endif